<template>
  <div class="more">
    <div class="header">
        <p>限时爆款 超级低价</p>
    </div>
    <div class="font">
        <ul>
            <li v-for="(item,index) in list" :key="index" @click="changeList(index)" :class="{active:currentIndex == index}">
            {{item}}
            </li>
        </ul>
    </div>
    <div class="list">
        <ul>
            <li v-for="(item,index) in shoplist" :key="index">
            <!-- <p>{{item.name}}</p> -->
            <img :src="item.picUrl" alt="">
            <div class="nav">
                <p class="p1">{{item.name}}</p>
                <p class="p0">{{item.monthSalesTip}}</p>
                <span class="p2">{{item.averagePriceTip}}</span>
                <span class="btn">马上抢</span>
                

            </div>
            </li>
        </ul>
    </div>
  </div>
</template>

<script>
import {shop_list,tuan_list,user_login} from './utils/api';

export default {
   data(){
    return{
        currentIndex:0,
        list:["正在抢购","上新预告"],
        shoplist:[]
    }
   },
   mounted(){
    shop_list({status:0}).then((res)=>{
        console.log(res.data);
        this.shoplist = res.data.list;
    })
   },
   methods:{
    changeList(index){
        this.currentIndex = index;
        console.log(this.shoplist);
    }
   }
}
</script>

<style lang="scss" scoped>
/* .more{
    background-color: hotpink;
    height: 300px;
    line-height: 300px;
    text-align: center;
} */
*{
    margin: 0;
    padding: 0;
}
.header{
    width: 100%;
    height: 150px;
    background-color: brown;
    text-align: center;
    line-height: 150px;
}
.header p{
    font-size: 20px;
    font-weight: bolder;
}
.active{
    background-color: hotpink;
    font-size: 18px;
    color: #fff;
    font-weight: bold;
}
.font li{
    width: 100px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    float: left;
    // margin-bottom: 30px;
}
ul{
    list-style: none;
}
.list ul{
    width: 100%;
    margin: 30px 0;
}
.list ul li{
    height: 100px;
    
    

}
img{
    width: 97px;
    height: 97px;
    
}
img:first-child{
    position: absolute;
    left: 0;
}
.nav{
    width: 60%;
    height: 100px;
    // background: yellowgreen;
    float: right;
}
.nav .footer{
    width: 100%;
    height: 30px;
    // background-color: blue;
}
.btn{
    margin-left: 50px;
    display: inline-block;
    width: 60px;
    height: 30px;
    background-color: brown;
    line-height: 30px;
    text-align: center;
    border-radius: 15px;
    color: #fff;

}
.p1{
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
}
.p0{
    font-size: 12px;
}
</style>